package com.dayuanit.spring.demo.listener;

import org.springframework.context.support.ClassPathXmlApplicationContext;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

@WebListener
public class AppListener implements ServletContextListener {
    public AppListener() {
        System.out.println(">>>>>>>>> AppListener() <<<<<<<<<<<");
    }

    @Override
    public void contextInitialized(ServletContextEvent sce) {
        //创建对象
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("spring-test.xml");
    }
}
